setAutoHeight();
$('.repair-middle .wrap').height($('.repair-middle .content').height()-$('.repair-middle .content h2').height()-2)
 
var getRootPath = function () {
    //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
    var curWwwPath = window.document.location.href;
    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
    var pathName = window.document.location.pathname;
    var pos = curWwwPath.indexOf(pathName);
    //获取主机地址，如： http://localhost:8083
    var localhostPaht = curWwwPath.substring(0, pos);
    //获取带"/"的项目名，如：/uimcardprj
    var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
    return (localhostPaht + projectName + '/');
  };
  Date.prototype.format = function(fmt) { 
	     var o = { 
	        "M+" : this.getMonth()+1,                 //月份 
	        "d+" : this.getDate(),                    //日 
	        "h+" : this.getHours(),                   //小时 
	        "m+" : this.getMinutes(),                 //分 
	        "s+" : this.getSeconds(),                 //秒 
	        "q+" : Math.floor((this.getMonth()+3)/3), //季度 
	        "S"  : this.getMilliseconds()             //毫秒 
	    }; 
	    if(/(y+)/.test(fmt)) {
	            fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 
	    }
	     for(var k in o) {
	        if(new RegExp("("+ k +")").test(fmt)){
	             fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
	         }
	     }
	    return fmt; 
	}
/**
 * @params data是当前时间
 * @params monthNum 可以传负数，表示当前日期往后几个月
 *
 */

  function GetPreMonthDay (date){
	  console.log(typeof date)
	  var daysInMonth = new Array([0],[31],[28],[31],[30],[31],[30],[31],[31],[30],[31],[30],[31]);      
	  	var strYear = date.getFullYear();        
	    var strDay = date.getDate();        
	    var strMonth = date.getMonth()+1;      
	    if(strYear%4 == 0 && strYear%100 != 0){      
	       daysInMonth[2] = 29;      
	    }      
	    if(strMonth - 1 == 0)      
	    {      
	       strYear -= 1;      
	       strMonth = 12;      
	    }      
	    else     
	    {      
	       strMonth -= 1;      
	    }      
	    strDay = daysInMonth[strMonth] >= strDay ? strDay : daysInMonth[strMonth];      
	    if(strMonth<10)        
	    {        
	       strMonth="0"+strMonth;        
	    }      
	    if(strDay<10)        
	    {        
	       strDay="0"+strDay;        
	    }      
	    datastr = strYear+"-"+strMonth+"-"+strDay+" 00:00:00";      
	    return datastr;      
  }
  
//删除数组指定项
Array.prototype.del = function (n) {  
	if (n < 0)         
		return this;   
	else return this.slice(0, n).concat(this.slice(n + 1, this.length));
	}
 

$(window).resize(function () {
    setAutoHeight();
    $('.repair-middle .wrap').height($('.repair-middle .content').height()-$('.repair-middle .content h2').height()-2)
})







//repair-middle 自适应
function setAutoHeight() {
    var allHeight = $(window).height();
    var mTop =  $('.repair-middle').offset().top;
    $('.repair-middle').height(allHeight-mTop-2);
}
